package com.zhenmaitang.clinic_sys.mapper;

import com.zhenmaitang.clinic_sys.entity.User;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

@Mapper
public interface UserMapper {
    
    User findByUsername(String username);
    
    User findById(Integer id);
    
    List<User> findAll();
    
    int insert(User user);
    
    int update(User user);
    
    int deleteById(Integer id);
    
    boolean existsByUsername(String username);
    
    boolean existsByEmail(String email);
    
    List<User> findByDepartmentId(Integer departmentId);
    
    List<User> findByRole(String role); 
}